
package supply;

import java.io.*;
import java.io.InputStreamReader;

public class Main {

   static int Mainmenu;
   static product pro=new product();
   static inventory inv=new inventory();

   public static void main(String[] args) throws IOException {
   InputStreamReader is1=new InputStreamReader(System.in);
   BufferedReader br1=new BufferedReader(is1);

   //product pro=new product();
   //inventory inv=new inventory();


   System.out.println("Select from the Following Menu :");
   System.out.println("________________________________");
   //System.out.println("0 -> Add The Product");
   System.out.println("1 -> Select the Product");
   System.out.println("2 -> Check Initial Items in the Inventory");

   Mainmenu=Integer.parseInt(br1.readLine());

   
   if(Mainmenu==1)
   {
        pro.selectProduct();
   }
  else if (Mainmenu==2)
   {
        inv.availableitems();
        starting();
   }
   
  else
  {
       System.out.println("Please Select the proper number : ");
  }

 }
    public static void starting() throws IOException
    {
    InputStreamReader is2=new InputStreamReader(System.in);
    BufferedReader br2=new BufferedReader(is2);
    System.out.println("Select from the Following Menu :");
    System.out.println("________________________________");
    System.out.println("1 -> Select the Product");
    //System.out.println("2 -> Check Items in the Inventory");
    System.out.println("-1 -> Close the program");
    Mainmenu=Integer.parseInt(br2.readLine());

    if(Mainmenu==1)
   {
        pro.selectProduct();
   }
  else if (Mainmenu==2)
   {
        inv.availableitems();
   }
  else if (Mainmenu==-1)
  {
      System.out.println("<--- Thanks for Using the Inventory System --->");
  }

  else
  {
       System.out.println("Please Select the proper number : ");
       starting();
  }
    
    }
     

}
